home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / pcmagdoc.arc / DRAW.DOC < prev    next >
Text File  |  1988-01-19  |  9KB  |  191 lines

  1.           DRAW                                Michael J. Mefford
  2.           Command                                     1987/No. 9
  3.  
  4.           ______________________________________________________
  5.  
  6.           Purpose:  Provides low-resolution (320 x 200) color or
  7.                     high-resolution (640 x 200) monochrome
  8.                     drawing capabilities on a color, enhanced
  9.                     color, or (with some MGA boards) a monochrome
  10.                     display, without the need to work in BASIC.
  11.  
  12.           Format:   [d:][path]DRAW[/K]  (Option I)
  13.                     [d:][path]DRAW string[/K]  (Option I)
  14.                     [d:][path]DRAW filespec/F[/K]  (Option II)
  15.  
  16.           Remarks:  Entered at the DOS prompt with no arguments
  17.                     on the command line (Option I), DRAW looks in
  18.                     the current directory for a file named
  19.                     DRAW.DAT and executes the commands in that
  20.                     file.  A sample DRAW.DAT file is included on
  21.                     this disk.  The file can be examined, and
  22.                     similar files created, with a regular ASCII
  23.                     word processor.
  24.  
  25.                     Alternatively, DRAW can be entered with a
  26.                     string of commands (Option II, for a simple
  27.                     graphic) or with the name of a file
  28.                     consisting of commands (Option III).  Any
  29.                     legal DOS filename may be used, and full path
  30.                     support is provided, but a /F terminator must
  31.                     be appended to the filename.  An optional /K
  32.                     may be added to prevent a keystroke from
  33.                     halting execution.
  34.  
  35.           Example:  You can get a feel for how DRAW operates by
  36.                     entering, at the DOS prompt:
  37.  
  38.                     DRAW X0 C2 BU50 M+40,70 L80 M+40,-70 BD5 P2,2
  39.  
  40.                     This will create a red triangle in the middle
  41.                     of your screen.  You can trace the specific
  42.                     steps in this command sequence by referring
  43.                     to The DRAW Command Set table, presented on
  44.                     succeeding pages in this manual.
  45.  
  46.                        The DRAW Command Set
  47.  
  48.           Xn   Change to low resolution 320X200 color graphics.
  49.  
  50.                If X is not found, the default is 640X200 high
  51.                resolution black and white graphics.  X must be
  52.                the first character of the command line or the
  53.                first character in a file.
  54.  
  55.                The palette will be changed to n, where n can be
  56.                either zero or one.  See C color command below for
  57.                the color of each palette.
  58.  
  59.           K    Do not poll the keyboard while drawing.  If K is
  60.                not found, any keystroke terminates the program.
  61.  
  62.           Sn   Flood the screen color to pattern n.  n must be a
  63.                decimal number in the range 0-255, and represents
  64.                an eight bit pattern.  Normally this command is
  65.                issued immediately after the X command (if
  66.                present), to clear the screen with a background
  67.                color other than black.  For example, to clear to
  68.                color red (2) in low resolution, the command is
  69.                S170 (binary 10101010).
  70.  
  71.                    color          320X200          640X200
  72.                      0               0                0
  73.                      1              85              255
  74.                      2             170               NA
  75.                      3             255               NA
  76.  
  77.                Pattern colors may also be used.  For example, a
  78.                pattern of half green and half black would be S58
  79.                (binary 01000100).  In high resolution, each bit
  80.                represents a dot, eight dots per byte.  This is
  81.                why only two colors (black or white) are
  82.                available.  In low resolution, there are two bits
  83.                per dot, so four combinations can be represented.
  84.                In the example here the sequence is 01 (green), 00
  85.                (black), 01 (green), 00 (black).  See C (color)
  86.                command below for complete coding of the colors.
  87.  
  88.           U,D,L,R,E,F,G,H
  89.                These commands, followed by a number, will move in
  90.                one of the following compass directions:
  91.  
  92.                                     U
  93.                             H       |       E
  94.                               \     |     /
  95.                                 \   |   /
  96.                                   \ | /
  97.                          L -- -- -- + -- -- -- R
  98.                                   / | \
  99.                                 /   |   \
  100.                               /     |     \
  101.                             G       |       F
  102.                                     D
  103.  
  104.           Mx,y Move x,y units either relative to the current
  105.                position or to the absolute coordinates, x,y.  If
  106.                the x coordinate is prefaced with either a plus
  107.                sign or minus sign, the move is relative.
  108.                Otherwise, the move is absolute.  Note, you do not
  109.                need to include a plus sign in front of the y
  110.                coordinate in a positive y move.
  111.  
  112.           Pp,b Paint the color p until the border color b is
  113.                found.  The paint originates from the current
  114.                position.
  115.  
  116.           B    Blank move.  The move following a B will move the
  117.                desired units without plotting points.  The next
  118.                command will then continue drawing.
  119.  
  120.           N    No update.  The draw command following an N
  121.                command will plot points, but the position will
  122.                not be updated.  The next draw command will start
  123.                at the same position as the last.
  124.  
  125.           Cn   Change the color to n.  All draws after a C
  126.                command will be in color n.  n can be 0 (black) or
  127.                1 (white) in high resolution and 0 to 3 in low
  128.                resolution.  In low resolution, the color is
  129.                dependent on the palette.
  130.  
  131.                                  320X200                 640X200
  132.                color     palette 0     palette 1
  133.                  0         black         black            black
  134.                  1         green         cyan             white
  135.                  2         red           magenta          NA
  136.                  3         yellow        white            NA
  137.  
  138.                              RELATED COMMANDS
  139.  
  140.                     Four commands, BSAVE.COM, BLOAD.COM,
  141.                     LOWRES.COM, and HIGHRES.COM, are included on
  142.                     this disk to speed the display of pictures
  143.                     created by DRAW.  (BSAVE and BLOAD may also
  144.                     be used with text screens for instant
  145.                     presentation.)  The command
  146.  
  147.                          BSAVE filespec
  148.  
  149.                     saves a byte image of the screen buffer to a
  150.                     file (with optional drive and path
  151.                     specifications), and
  152.  
  153.                          BLOAD filespec
  154.  
  155.                     writes the saved image back to the screen
  156.                     buffer.
  157.  
  158.                     LOWRES and HIGHRES are used in batch files
  159.                     with BLOAD to set the appropriate display
  160.                     resolution.
  161.  
  162.           Example:  Create the following batch file, SAVE.BAT,
  163.                     using an ASCII word processor, EDLIN, or COPY
  164.                     CON:
  165.  
  166.                          ECHO OFF
  167.                          DRAW DRAW.DAT/F
  168.                          BSAVE PICTURE
  169.  
  170.                     Now, similarly create a second batch file,
  171.                     INSTANT.BAT:
  172.  
  173.                          ECHO OFF
  174.                          LOWRES
  175.                          BLOAD PICTURE
  176.                          PLAY STING.DAT/F
  177.                          PAUSE > NUL
  178.                          MODE CO80
  179.  
  180.                     If you now enter INSTANT at the DOS prompt
  181.                     the picture of two con men will appear, with
  182.                     appropriate musical background.  Pressing any
  183.                     keystroke will clear the display.
  184.  
  185.                     Note:
  186.  
  187.                     1.   The PAUSE > NUL line in INSTANT.BAT
  188.                          prevents the DOS prompt from intruding
  189.                          on the picture, but will not work on DOS
  190.                          versions prior to DOS 3.
  191.